import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';

export const getSpace = (params) => {
  return defHttp.get({url: '/iam-service/manage/permSpace/getSpace', params});
}

export const pageSpace = (params) => {
  return defHttp.get({url: '/iam-service/manage/permSpace/pageSpace', params});
}

export const listSpace = (params) => {
  return defHttp.get({url: '/iam-service/manage/permSpace/listSpace', params});
}

export const saveOrUpdateSpace = (params, isUpdate) => {
  let url = '/iam-service/manage/permSpace/' + (isUpdate ? 'updateSpace' : 'saveSpace');
  return defHttp.post({url: url, params});
}

export const deleteSpace = (params, handleSuccess) => {
  return defHttp.delete({url: '/iam-service/manage/permSpace/deleteSpace', data: params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
